package fr.efrei.musicpliz.service;

import java.util.List;

import fr.efrei.musicpliz.dto.CompteDto;
import fr.efrei.musicpliz.entity.Compte;

public interface CompteService {
	
	/**
	 * Create a new Compte or update an existing Compte 
	 * with the data provided from the CompteDto
	 * @param dto
	 * 		The dto with all the necessary Data
	 * @return
	 * 		the created/updated and stored Compte
	 */
	public Compte saveCompte(CompteDto dto);
	
	/**
	 * Get a <b>CompteDto</b> by the eMail address (the ID)
	 * @param email
	 * 		The name of the email address
	 * @return
	 * 		the CompteDto with the specified email address
	 */
	public CompteDto getCompteForEmail(String email);
	
	public Compte getCompteForId(int id);
	
	/**
	 * Get all <b>Comptes of a certain</b> type
	 * @param <T>
	 * 		Type of the Compte you d'like to receive
	 * @param instance
	 * 		An instance (can be an empty one -> "new Compte()") to determine the class
	 * @return
	 * 		A List of all the Compte's found on the DB
	 */
	public <T extends Compte> List<T> getAllComptes(T instance);
	
	/**
	 * Get all <b>Comptes</b> corresponding to the data in the Dto
	 * @param dto
	 * 		All the restrictions (AND-connected)
	 * @return
	 * 		A List of all the Compte's found on the DB
	 */
	public List<CompteDto> searchComptesForDto(CompteDto dto);
}
